Skip to content

Conversation

@egouden
Copy link
Contributor

@egouden egouden commented Oct 2, 2025

This is useful for stacking single sweeps or creating a new volume logic based on time.

@codecov
Copy link

codecov bot commented Oct 2, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.58%. Comparing base (6496432) to head (2793eb1).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #307      +/-   ##
==========================================
+ Coverage   93.52%   93.58%   +0.06%     
==========================================
  Files          27       27              
  Lines        5572     5613      +41     
==========================================
+ Hits         5211     5253      +42     
+ Misses        361      360       -1     
Flag Coverage Δ
notebooktests 0.00% <0.00%> (ø)
unittests 93.58% <100.00%> (+0.06%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@egouden
Copy link
Contributor Author

egouden commented Oct 9, 2025

I added the option to select sweeps by angle. This is useful if you want to discard a calibration scan (i.e. 90 degree).

@egouden
Copy link
Contributor Author

egouden commented Oct 9, 2025

@kmuehlbauer

I found inconsistencies in the global variable sweep_group_name. Should it be a list of strings or ints? Most readers return ints but cfradial1 reader returns strings. There is also a conversion in the global metadata constructor.

I think the string is better because it is consistent with the variable name and you can use it directly for accessing the sweeps. I guess this has no negative impact on the performance.

@egouden egouden force-pushed the create_volume branch 2 times, most recently from 4c71b4b to 41ab76e Compare October 13, 2025 10:09
@egouden
Copy link
Contributor Author

egouden commented Oct 13, 2025

np.datetime64 is now used internally to avoid local time issues

Copy link
Collaborator

@kmuehlbauer kmuehlbauer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@egouden This is a nice addition. I've added a couple of comments.

# Step 4: Sort by time
sweep_entries.sort(key=lambda x: x[1])

if not sweep_entries:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it make more sense to return an empty volume, instead of raising here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a philosophical question. Returning an empty volume is misleading in my opinion. It could break downstream with less context. I let you decide what is best for consistency across the package.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is an empty volume exactly?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An empty DataTree? A volume missing any sweeps. Just the remaining metadata. But you made a point here. Skip my idea and raise as intended. We can iterate on that later, if the necessity arises.

time_coverage_start = datetime.datetime.fromisoformat(time_coverage_start)
time_coverage_end = "2023-04-19T06:55:00Z"
time_coverage_end = datetime.datetime.fromisoformat(time_coverage_end)
with pytest.raises(ValueError, match="No sweeps remain after filtering."):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comment below. I'd rather check here for empty volume.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See above.

if not sweep_entries:
raise ValueError("No sweeps remain after filtering.")

# Step 5: Prepare root metadata
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering if it would be possible to do this without the deep copy?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Absolutely

@egouden egouden marked this pull request as draft October 24, 2025 14:09
@egouden egouden marked this pull request as ready for review October 24, 2025 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants